<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition 
    template="./WEB-INF/template/template_logout.xhtml"
    xmlns:h="http://xmlns.jcp.org/jsf/html"
    xmlns:p="http://primefaces.org/ui"
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:f="http://xmlns.jcp.org/jsf/core"
    xmlns:ui="http://xmlns.jcp.org/jsf/facelets">

    <ui:define name="content">
        <p:growl id="growl" life="3000"/>
        <h:form id="form"> 
            <div id="tabla" >
                <h:dataTable id="offers" var="offer" value="#{tableOfferBean.offer}" >  
                    <h:column  >  
                        <f:facet name="header">
                            <h:outputText value="Descripcion" />
                        </f:facet>
                        <h:outputText value="#{offer.descripcion}" />  
                    </h:column>  
                   <h:column>  
                        <f:facet name="">
                            <h:outputText value="" />
                        </f:facet>
                        <h:outputText value="" />  
                    </h:column>  
                    <h:column  >  
                        <f:facet name="header">
                            <h:outputText value="Titulo" />
                        </f:facet>
                        <h:outputText value="#{offer.titulo}" />  
                    </h:column>  

                    <h:column  >  
                        <f:facet name="header">
                            <h:outputText value="Fecha de fin" />
                        </f:facet>
                        <h:outputText value="#{offer.dateEnd}"/>  
                    </h:column>  

                    <h:column >  
                        <f:facet name="header">
                            <h:outputText value="" />
                        </f:facet>

                        <h:commandButton value="Modificar" action="#{tableOfferBean.modificar()}" image="resources/images/ver.jpg" styleClass="button"  title="modificar">
                            <f:setPropertyActionListener value="#{offer}" target="#{tableOfferBean.selectedOffer}" />  
                        </h:commandButton>

                    </h:column>  
                    <h:column >  
                        <f:facet name="header">
                            <h:outputText value="" />
                        </f:facet>

                        <h:commandButton id="buttonBorrar" value="Borrar" action="#{tableOfferBean.borrar()}" styleClass="button"  image="resources/images/delete.jpg"  title="borrar" >
                            <f:setPropertyActionListener value="#{offer}" target="#{tableOfferBean.selectedOffer}" />  
                        </h:commandButton>

                    </h:column>  

                </h:dataTable>  
            </div>
            <div id="bontonInsertar" >
                <h:commandButton value="Nueva Oferta" action="#{tableOfferBean.insertar()}" styleClass="button"  title="View"/>
            </div>
        </h:form>
    </ui:define>

</ui:composition>
